<!DOCTYPE html>
<html lang="{{ .Site.LanguageCode }}">
  <head>
    <meta charset="utf-8">
    <!--link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"--> <!--- Icons --->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.15.4/css/all.min.css"> <!--- Icons --->
    <link rel="stylesheet" href="/fonts/academicons-1.8.6/css/academicons.min.css"/>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css">
    <link rel="icon" type="image/png" sizes="32x32" href="/img/logo.png"> <!--- Likan Icon --->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="baidu-site-verification" content="{{ .Site.Params.baiduSiteVerificateID }}" />
    {{ if eq .URL "/" }}
    <title>{{ .Site.Title }}</title>
    <meta property="og:title" content="{{ .Site.Title }}" />
    <meta property="og:type" content="website">
    {{ else }}
    <!--- Use different titles in different Language versions, 20180210 by Likan Zhan --->
    {{ $section := default .Section ($.Scratch.Get "section") }}
    <!-- <title>{{ .Title }}{{ with .Params.subtitle }} - {{ . }} {{ end }} - {{ (index $.Site.Params.author $section) }}</title> -->
    <!--- Use different titles in different Language versions, 20180210 by Likan Zhan --->
    <!--steven 20190819 -->
    <title>{{ .Title }}{{ with .Params.subtitle }} - {{ . }} {{ end }} - {{ .Site.Title }}</title> 
    <meta property="og:title" content="{{ .Title }} - {{ .Site.Title }}">
    {{ end }}

    {{ if eq .URL "/" }}
    <meta property="description" content="{{ .Site.Params.description }}">
    {{ else }}
      {{ if .Description }}
      <meta property="description" content="{{ .Description }}">
      {{ end }}
    {{ end }}

    {{ if .Keywords }}
    <meta property="keywords" content ="{{ delimit .Keywords ", " }}">
    {{ end }}

    {{ with .OutputFormats.Get "RSS" }}
    <link href="{{ .RelPermalink | relURL }}" rel="alternate" type="application/rss+xml" title="{{ $.Title }}" />
    {{ end }}
  
    <link rel="stylesheet" href="{{ $.Site.BaseURL }}/css/style.css"/>
    <link rel="stylesheet" href="{{ $.Site.BaseURL }}/css/fonts.css"/>
    {{ partial "head_custom.html" . }}
  </head>

  {{ $.Scratch.Set "section" (replaceRE "^/([^/]+)/.*" "$1" .URL) }}
  <body class="{{ if .IsHome }}home{{ else }}{{ $.Scratch.Get "section" }}{{ end }}">
    {{/*
    <header class="masthead">
      {{ partial "tagline.html" . }}
      <nav class="menu">
        <input id="menu-check" type="checkbox" />
        <label id="menu-label" for="menu-check" class="unselectable">
          <span class="icon close-icon">✕</span>
          <span class="icon open-icon">☰</span>
          <span class="text">Menu</span>
        </label>
        <ul>
        {{ $currentPage := . }}
        {{ range (default .Site.Menus.main (index .Site.Menus ($.Scratch.Get "section"))) }}
        <li{{ if eq .URL $currentPage.URL }} class="active"{{ end }}><a href="{{ .URL }}">{{ .Name }}</a></li>
        {{ end }}
        {{ partial "menu_extra.html" . }}
        </ul>
      </nav>
    </header>
    */}}
    
    <header class="intro-and-nav" role="banner">
    <div>
      <div class="intro">
        <a class="logo" href="/" aria-label="{{ .Site.Title }} home page">
          <img src="{{ "img/logo.png" | absURL }}" alt="">
        </a>
        <p class="library-desc">
          {{ with .Site.Params.description }}
            {{ . | markdownify }}
          {{ end }}
        </p>
      </div>
      <nav id="patterns-nav" class="patterns" role="navigation">
        <h2 class="vh">Main navigation</h2>
        <button id="menu-button" aria-expanded="false">
          <!--svg viewBox="0 0 50 50" aria-hidden="true" focusable="false">
            <use xlink:href="#menu"></use>
          </svg-->
          目录
        </button>
        {{ $current := . }}
        <ul id="patterns-list">
          {{ range (default .Site.Menus.main (index .Site.Menus ($.Scratch.Get "section"))) }}
          <li class="pattern">
          {{ $active := or ($current.IsMenuCurrent "main" .) ($current.HasMenuCurrent "main" .) }}
          {{ $active = or $active (eq .Name $current.Title) }}
	  {{ $active = or $active (findRE .Name $current.Description) }}
          {{ $active = or $active (and (eq .Name "Blog") (eq $current.Section "post")) }}
          {{ $active = or $active (and (eq .Name "Tags") (eq $current.Section "tags")) }}
            <a href="{{ .URL }}" {{ if $active }}aria-current="page"{{ end }}>
              <!--svg class="bookmark-icon" aria-hidden="true" focusable="false" viewBox="0 0 40 50">
                <use xlink:href="#bookmark"></use>
              </svg>
              <span class="text">{{ .Name }}</span-->
              {{ .Name }}
            </a>
          </li>
          {{ end }}
          {{ partial "menu_extra.html" . }}
        </ul>
      </nav>
    </div>
    </header>

    <article class="main">
      <header class="title">
      {{ partial "meta.html" . }}
      </header>
